<?php
/**
 * 情报
 */
namespace app\sports\match\controller;

use app\common\BaseController;
use app\sports\match\service\IntelligenceService;

class Intelligence extends BaseController
{
    /**
     * 获取情报
     */
    public function getIntelligenceByMatchId()
    {
        $data = $this->request->post();
        $matchId = isset($data['match_id']) ? $data['match_id'] : 0;
        if (empty($matchId)) {
            $this->jsonReturn(-1, [], '比赛ID不能为空');
        }

        $isHome = isset($data['is_home']) ? $data['is_home'] : 1;
        $intelligenceService = new IntelligenceService();
        $data = $intelligenceService->getIntelligenceByMatchId($matchId, $isHome);
        $this->jsonReturn(0, $data);
    }
}